<template>
    <div style="width: 100%;">
        <van-search v-model="value" right-icon="replay" show-action placeholder="请输入搜索关键词" @search="onSearch">
            <template #action>
                <div @click="onClickButton"> 
                    <van-icon name="apps-o" size="25" /><br>
                    <span > 分类</span>
                    </div>
            </template>
               <template #left>
                <van-icon name="coupon-o" size="25" />
            </template>
        </van-search>
    </div>
</template>

<script setup>
import { useRouter } from 'vue-router';
const router = useRouter()
const onSearch = () => {
    console.log('回车触发搜索事件');
    router.push('/search')

}
</script>

<style lang="scss" scoped></style>